package com.rockcent.mall.lib.repository;

import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.CustomerShoppingAddress;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by oyhk on 14-6-22.
 */
@Repository
public interface CustomerShoppingAddressRepository extends JpaRepository<CustomerShoppingAddress, Long>, JpaSpecificationExecutor {


    CustomerShoppingAddress findByIdAndCustomerId(Long id,Long customerId);

    List<CustomerShoppingAddress> findByCustomerId(Long customerId);

    CustomerShoppingAddress findByCustomerIdAndIsDefaultAndIsDelete(Long customerId, Boolean isDefault, Whether isDelete);

}
